<template>
	<view>
		<web-view :src="url" @message="getMessage"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: 'https://43.136.77.140/example/chat/'
			}
		},
		onLoad(options) {
			
			console.log("加载好了")
			// 打开一个外部网页
			// plus.runtime.openURL('https://43.136.77.140/example/real-time-fast-OSS/');
			    // var openPromise = hx.env.openExternal("https://www.dcloud.io");
			    // openPromise.then(function(success) {
			    //     console.log("打开链接结果：",success);
			    // });

			if (options && options.url) {
				this.url = options.url;
			}
		},
		methods: {
			getMessage(event) {
				uni.showModal({
					content: JSON.stringify(event.detail),
					showCancel: false
				});
			}
		}
	}
</script>

<style>

</style>
